package br.com.ccm.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(schema="geral")
public class Clinica implements Serializable {

	private static final long serialVersionUID = -74940082713664233L;
	
	@Id 
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ")
	@SequenceGenerator(schema = "geral", initialValue = 1, name = "SEQ", sequenceName = "geral.seq_clinica", allocationSize = 1)
	private Long id;
	
	@ManyToOne
	@JoinColumn(name="endereco_id")
	private Endereco endereco;
	
	@OneToMany
	private List<TelefonePaciente> telefones;
	
	@ManyToMany
	private List<Medico> medicos;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Endereco getEndereco() {
		return endereco;
	}

	public void setEndereco(Endereco endereco) {
		this.endereco = endereco;
	}

	public List<TelefonePaciente> getTelefones() {
		return telefones;
	}

	public void setTelefones(List<TelefonePaciente> telefones) {
		this.telefones = telefones;
	}

	public List<Medico> getMedicos() {
		return medicos;
	}

	public void setMedicos(List<Medico> medicos) {
		this.medicos = medicos;
	}
}
